package Text25;

import java.io.*;
import java.util.Arrays;

public class Main {
    static int N = 50010;
    static int len = 0;//有多少个满足
    static int[] ans = new int[N];
    static int[] primes = new int[N];
    static boolean[] st = new boolean[N];
    static int cnt = 0;

    static boolean is_primes(int x) {
        if (x < N) {
            return !st[x];
        }
        for (int i = 0; primes[i] < x / primes[i]; i++) {
            if (x % primes[i] == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        get_primes(N - 1);
        String str = "";
        while ((str = in.readLine()) != null) {
            int s = Integer.parseInt(str);
            len = 0;
            dfs(-1, 1, s);
            out.write(len + "\n");
            if (len > 0) {
                Arrays.sort(ans, 0, len);
                for (int i = 0; i < len; i++) {
                    out.write(ans[i] + " ");
                }
                out.write("\n");
            }
            out.flush();
        }

    }

    private static void dfs(int u, int pro, int s) {
        if (s == 1) {
            ans[len++] = pro;
            return;
        }
        if (is_primes(s - 1) && s - 1 > (u < 0 ? 1 : primes[u])) {
            ans[len++] = pro * (s - 1);
        }
        for (int i = u + 1; primes[i] <= s / primes[i]; i++) {
            int p = primes[i];
            for (int j = 1 + p, t = p; j <= s; t *= p, j += t) {
                if (s % j == 0) {
                    dfs(i, pro * t, s / j);
                }
            }
        }
    }

    private static void get_primes(int n) {
        for (int i = 2; i <= n; i++) {
            if (!st[i]) {
                primes[cnt++] = i;
            }
            for (int j = 0; primes[j] * i <= n; j++) {
                st[primes[j] * i] = true;
                if (i % primes[j] == 0) {
                    break;
                }
            }
        }
    }

}
